package cn.mxb.logic.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.mxb.floor.pagination.Result;
import cn.mxb.logic.dao.OrganizationDAO;
import cn.mxb.logic.entity.Organization;
import cn.mxb.logic.service.IOrganizationService;

@Service("organizationService")
public class OrganizationServiceImpl  implements IOrganizationService {

	@Autowired
	private OrganizationDAO organizationDAO;
	
	
	@Override
	public Organization findByProperty(String property, String value) {
		return organizationDAO.findByProperty(property, value);
	}

	/**
	 * 分页
	 */
	@Override
	public Result<Organization> find(Organization organization, int page, int row) {
		return organizationDAO.find(organization, page, row);
	}

	/**
	 * add
	 */
	@Override
	public Organization add(Organization organization) {
		return organizationDAO.save(organization);
	}

	@Override
	public void delete(int id) {
		organizationDAO.remove(Organization.class,id);
	}
	@Override
	public void update(Organization organization) {
		
	}
	
	@Override
	public List<Organization> findListByProperty(String property, String value) {
		return organizationDAO.findListByProperty(property, value);
	}

	/**
	 * 查询全部
	 */
	@Override
	public List<Organization> findAllList() {
		return organizationDAO.getAll(Organization.class);
	}


	
}
